package com.jason.library.immersion

import android.app.Activity
import com.jason.library.immersion.core.transparentBar
import com.jason.library.immersion.core.updateNavigationBar
import com.jason.library.immersion.core.updateStatusBar
import com.jason.library.immersion.model.BarParams

/**
 * Description:
 *
 * @author chenbaoyang
 * @create 2021/1/11 15:19
 */
class Immersion private constructor(){

    private lateinit var activity: Activity
    private lateinit var params: BarParams

    companion object {

        fun getInstance() : Immersion {
            return SingleTon.mInstance
        }


    }

    private object SingleTon {
        val mInstance = Immersion()
    }


    fun with(activity: Activity) : Immersion {
        this.activity = activity
        return this
    }

    fun barParams(params: BarParams) : Immersion {
        this.params = params
        return this
    }
    
    fun apply() {
        activity.updateStatusBar(params)
        activity.updateNavigationBar(params)
        activity.transparentBar(params)
    }






}